/* Light mode CSS variables */
:root {
  /* Light Mode Colors - Figma Design Tokens */
  --bg-primary: #ffffff;
  --bg-tertiary: #f4f4f5;
  --text-primary-900: #101828;
  --text-secondary-700: #3f3f46;
  --text-tertiary-600: #51525c;
  --text-quaternary-500: #70707b;
  --border-primary: #d1d1d6;
  --border-secondary: #e4e4e7;
  --border-tertiary: #f4f4f5;
  --brand-600: #2f6868;
  --brand-100: #d9eeec;
  --fg-primary-900: #1a1a1e;

  /* Typography - Figma Tokens */
  --font-family: "Inter", system-ui, -apple-system, sans-serif;
}

/* Dark Mode Colors */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a1a1e;
    --bg-tertiary: #2a2a2e;
    --text-primary-900: #ffffff;
    --text-secondary-700: #d1d1d6;
    --text-tertiary-600: #a1a1aa;
    --text-quaternary-500: #8a8a95;
    --border-primary: #3f3f46;
    --border-secondary: #2a2a2e;
    --border-tertiary: #1f1f23;
    --brand-600: #2f6868;
    --brand-100: #1a2c2a;
    --fg-primary-900: #ffffff;
  }
}

/* Base styles */
body {
  background-color: var(--bg-primary);
  color: var(--text-secondary-700);
  font-family: var(--font-family);
}

/* Wider content area for better code display (100-120 character lines) */
.prose,
.prose-sm,
.prose-lg,
article,
.markdown,
.content,
main > div,
[class*="prose"] {
  max-width: 90rem !important; /* ~1440px instead of default ~896px */
}

/* Adjust code blocks specifically for better line length */
pre,
code,
.highlight,
.code-block,
[class*="language-"] {
  max-width: none !important;
  width: 100% !important;
  white-space: pre-wrap !important; /* Allow code to wrap while preserving formatting */
  word-wrap: break-word !important; /* Break long words if necessary */
  overflow-wrap: break-word !important; /* Modern property for word wrapping */
}

.prose > .group > span.cursor-pointer > code {
  width: auto !important;
}

/* Ensure the main container accommodates the wider content */
.container,
.max-w-7xl,
.mx-auto {
  max-width: 100rem !important; /* ~1600px */
  padding-left: 2rem !important;
  padding-right: 2rem !important;
}

/* Style "breadcrumbs" link element */
.inline-flex.items-center.gap-1\.5.text-sm.text-gray-500 {
  color: var(--colours-text-text-quaternary-500, #70707b) !important;
  font-family: Inter !important;
  font-size: 12px !important;
  font-style: normal !important;
  font-weight: 500 !important;
  line-height: 100% !important;
  letter-spacing: 0.48px !important;
  text-transform: uppercase !important;
}

#page-title {
  font-family: var(--font-family);
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: 120%;
  letter-spacing: -0.72px;
}

#mdx-content {
  color: var(--text-secondary-700);
  font-family: var(--font-family);
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 150%;
}

/* Reset browser default heading styles */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: normal;
  margin: 0;
}

/* Heading hierarchy styles */
h1,
#mdx-content h1,
.prose h1,
article h1,
main h1 {
  font-family: var(--font-family);
  font-size: 24px;
  font-style: normal;
  font-weight: 400 !important;
  line-height: 120%; /* 28.8px */
  letter-spacing: -0.72px;
}

h2,
#mdx-content h2 {
  color: var(--text-primary-900);
  font-family: var(--font-family);
  font-size: 18px;
  font-style: normal;
  font-weight: 400 !important;
  line-height: 120%;
  letter-spacing: -0.72px;
}

h3,
#mdx-content h3 {
  color: var(--text-primary-900);
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 400 !important;
  line-height: 130%;
  letter-spacing: -0.36px;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

h4,
#mdx-content h4 {
  color: var(--text-primary-900);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400 !important;
  line-height: 135%;
  letter-spacing: -0.32px;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

h5,
#mdx-content h5 {
  color: var(--text-quaternary-500);
  font-family: var(--font-family);
  font-size: 12px;
  font-style: normal;
  font-weight: 500 !important;
  line-height: 100%;
  letter-spacing: 0.48px;
  text-transform: uppercase;
}

/* Nav dropdown styling */
.nav-dropdown-item-icon,
.nav-dropdown-item-icon > img {
  background-color: transparent !important;
  border: none !important;
}

.topbar-right-container {
  flex: 0;
}

/* Targets the container that has the search input */
:has(> .topbar-right-container) > :nth-child(2) {
  justify-content: end;
}

/* Fix version picker text truncation and ensure arrow is visible */
button.version-picker-button,
button[class*="version-picker"],
button[aria-label*="version"],
.version-picker-button {
  min-width: 100px !important; /* Fit "JavaScript" + arrow */
  width: auto !important;
  overflow: visible !important; /* Allow content to overflow if needed */
  font-size: 11px !important; /* Make text smaller */
  gap: 0.5rem !important; /* Standardize spacing between text and arrow */
  justify-content: space-between !important; /* Even distribution */
}

/* Ensure version picker maintains size during initial load */
button:has(> span + svg) {
  min-width: 100px !important;
  width: auto !important;
}

button.version-picker-button span {
  white-space: nowrap !important; /* Prevent text wrapping */
  overflow: visible !important; /* Show full text */
  text-overflow: initial !important; /* Remove ellipsis */
  flex-shrink: 0 !important; /* Don't shrink the text */
  margin-right: 0 !important; /* Remove any extra margin */
}

/* Force the dropdown arrow to always show */
button.version-picker-button svg {
  display: block !important; /* Force display */
  visibility: visible !important; /* Force visibility */
  opacity: 1 !important; /* Make sure it's opaque */
  flex-shrink: 0 !important; /* Don't shrink */
  width: 12px !important; /* Set fixed width */
  height: 12px !important; /* Set fixed height */
  margin-left: 0 !important; /* Remove any extra margin */
}

/* Add padding to the top of navbar tabs and increase container height */
#navbar-transition-willow {
  padding-top: 1rem !important;
  height: calc(
    3rem + 1rem
  ) !important; /* Original h-12 (3rem) + added top padding */
}

/* Adjust main content to account for taller navbar */
main {
  padding-top: 2rem !important;
}

/* Fix breadcrumbs and page title positioning */
.breadcrumb,
[class*="breadcrumb"],
#page-title {
  margin-top: 1rem !important;
}

/* Add padding to assistant panel to match increased navbar height */
[class*="assistant"],
[class*="chat"],
.assistant-panel,
aside[class*="assistant"] {
  padding-top: 1rem !important;
}


/* Target span elements within each header type */
h1 span,
h2 span,
h3 span,
h4 span,
h5 span,
h6 span {
  display: flex;
  align-items: center;
}

h1 span img,
h2 span img,
h3 span img,
h4 span img,
h5 span img,
h6 span img {
  background-color: transparent !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

#banner {
  max-width: 100% !important;
  color: var(--brand-600) !important; /* Use the dark green brand color */
}

#banner * {
  color: var(
    --brand-600
  ) !important; /* Force all banner text to use brand color */
}

#banner a {
  text-decoration: underline !important;
  color: var(
    --brand-600
  ) !important; /* Ensure links also use the brand color */
}

/* Ensure callout links and lists match callout text formatting */
.callout a,
[class*="callout"] a {
  font-size: inherit !important; /* Match callout text size */
  color: inherit !important; /* Match callout text color */
  text-decoration: inherit !important; /* Inherit callout text decoration */
}

.callout ul,
.callout ol,
.callout li,
[class*="callout"] ul,
[class*="callout"] ol,
[class*="callout"] li {
  font-size: inherit !important; /* Match callout text size */
  color: inherit !important; /* Match callout text color */
  line-height: inherit !important; /* Match callout line height */
}

.callout p,
[class*="callout"] p {
  font-size: inherit !important; /* Match callout text size */
  color: inherit !important; /* Match callout text color */
}

/* Ensure bold and italic text inherit callout formatting */
.callout strong,
.callout b,
.callout em,
.callout i,
[class*="callout"] strong,
[class*="callout"] b,
[class*="callout"] em,
[class*="callout"] i {
  font-size: inherit !important; /* Match callout text size */
  color: inherit !important; /* Match callout text color */
}

/* Ensure mermaid diagrams are centered */
.mermaid {
    text-align: center;
    display: flex;
    justify-content: center;
  }

/* Responsive tables with horizontal scrolling */
table {
  /* Table layout preserved for proper caption/column sizing */
}

/* Responsive tables with horizontal scrolling */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  width: 100%;
}

/* Prevent table cells from breaking layout */
table th {
  white-space: nowrap;
}
